package com.fengchao;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@EnableScheduling
public class ServerPayApplication implements CommandLineRunner {

    @Autowired
    private Environment env;

    private static Logger logger = LoggerFactory.getLogger(ServerPayApplication.class);

    public static void main(String[] args) {
        SpringApplication.run(ServerPayApplication.class, args);
    }

    @Override
    public void run(String... strings) throws Exception {
        logger.info("env:{}", env.getProperty("spring.profiles.active"));
        logger.info("database:{}", env.getProperty("spring.datasource.url"));
    }
}


